import { LinValidator, Rule } from 'lin-mizar';


class AddFlowValidator extends LinValidator {
  constructor() {
    super();
    // this.index = [
    //   new Rule('isNotEmpty', '必须指定期刊内容排序'),
    //   new Rule('isInt', '期刊排序必须为正整数', { min: 1 }),
    // ]
    this.type = [
      new Rule('isNotEmpty', '期刊类型不能为空'),
      new Rule('isInt', '期刊类型id必须为数字'),
    ]
    this.art_id = [
      new Rule('isNotEmpty', '期刊id不能为空'),
      new Rule('isInt', '期刊id必须为数字'),
    ]
    // this.status = [
    //   new Rule('isNotEmpty', '期刊有效状态不能为空'),
    //   new Rule('isInt', '期刊有效状态表示不正确'),
    // ]
  }
}

class EditFlowValidator extends AddFlowValidator {
  constructor() {
    super();
    this.id = [
      new Rule('isNotEmpty', '最新期刊内容id不能为空'),
      new Rule('isInt', '最新期刊内容id表示不正确', { min: 1 }),
    ]
  }
}


class DeleteFlowValidator extends LinValidator {
  constructor() {
    super();
    this.id = [
      new Rule('isNotEmpty', '最新期刊内容id不能为空'),
      new Rule('isInt', '最新期刊内容id表示不正确', { min: 1 }),
    ]
  }
}

export { AddFlowValidator, EditFlowValidator, DeleteFlowValidator };
